package test.controller;

import feign.FeignException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import top.frsf.starter.utils.Result;

/**
 * @author He Kuntao
 * @since 2024/9/14 11:47
 */
@RestControllerAdvice
public class GlobalExceptionAdvice {

  @ExceptionHandler(FeignException.class)
  public Result handleException(FeignException e) {
    Result result = new Result();
    result.setCode(e.status());
    result.setMsg("token无效或过期");
    return result;
  }

}
